﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Infrastucture.Collections
{
    public static class CollectionExtensions
    {
        public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> coll)
        {
            var c = new ObservableCollection<T>();

            foreach (var e in coll)
                c.Add(e);

            return c;
        }

        public static EditableList<T> ToEditableList<T>(this IEnumerable<DomainObject> coll)
        {
            var c = new EditableList<T>();

            foreach (var e in coll)
                c.Add(e);

            return c;
        }
    }
}
